#include<stdio.h>

int main()
{
	float a, b;
	float fee = 0;
	scanf_s("%f%f", &a, &b);
	a += b / 5;
	if (a <= 3)
	{
		fee = 10;
	}
	else if (a <= 13)
	{
		fee = 10 +  (a - 3) * 2;
	}
	else
	{
		fee = 10 + 10 * 2 + (a - 13) * 3;
	}
	printf("%.0f\n", fee);
	return 0;
}